import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.药房管理.处方发药.chufangfayao__page import chufangfayao
from tools.sjqd_way import read_data_from_excel
class TestChufangfayao(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('处方发药')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    # @unittest.skip
    def test_1_chufangfayao(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = chufangfayao()
        bp.choose_yf()  # 选择药房
        bp.choose_dfy()  # 选择待发药
        bp.input_name(name)#输入患者姓名
        bp.click_cx_btn()#点击查询按钮
        bp.choose_sj1()#选择数据1
        bp.click_fy_btn()#点击发药按钮
        bp.click_qd_btn()#点击确定按钮
    #材料
    @unittest.skip
    def test_2_chufangfayao_cailiao(self):
        bp = chufangfayao()
        bp.choose_clyf()#选择材料房
        bp.choose_dfy()  # 选择待发药
        bp.click_cx_btn()#点击查询按钮
        bp.shuju1.Refind()
        bp.choose_sj1()#选择数据1
        bp.click_fy_btn()#点击发药按钮
        bp.tishi.Refind()
        bp.queding.Refind()
        bp.click_qd_btn()#点击确定按钮
if __name__ == '__main__':
    unittest.main()



